{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import torch\n",
    "import os\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# experiments = ['avg_loss', 'dpixel', 'dunits', 'abonly', 'fimabl', 'dboth', 'abdisc', 'fimadp', 'fimadu', 'fimadb']\n",
    "experiments = ['avg_loss', 'dpixel', 'dboth20', 'abdisc20', 'fimadb20', 'fimadbm10', 'fimadbm20']\n",
    "\n",
    "for scene, obj in [\n",
    "        ('churchoutdoor', 'door'),\n",
    "        ('churchoutdoor', 'tree'),\n",
    "        ('bedroom', 'window'),\n",
    "        ('conferenceroom', 'window')]:\n",
    "    for variant in ['ace_reg0.005']:\n",
    "\n",
    "        snapdir = 'dissect/%s/layer4/%s/%s/snapshots' % (scene, variant, obj)\n",
    "\n",
    "        data = []\n",
    "        for i in range(-1, 10):\n",
    "            data.append(torch.load(os.path.join(snapdir, 'epoch-%d.pth' % i)))\n",
    "        for key in experiments:\n",
    "                baseline = data[0][key]\n",
    "                plt.plot([d[key] / baseline for d in data], label=key)\n",
    "        plt.title('%s %s %s'% (scene, variant, obj))\n",
    "        plt.legend()\n",
    "        plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}